package com.snack.controller;

import com.snack.common.result.Result;
import com.snack.entity.pojo.Member;
import com.snack.entity.pojo.User;
import com.snack.service.MemberService;
import com.snack.service.UserService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author huangfuhao
 * @Date 2025/4/16
 */
@RestController
@RequestMapping("/api/member")
public class MemberController {

    @Resource
    private MemberService memberService;



    public MemberController(MemberService memberService) {
        this.memberService = memberService;
    }

    @RequestMapping("/addMember")
    public Result addMember(@RequestBody Member member) {
        return memberService.addMember(member);
    }

    @RequestMapping("/getMember")
    public Result getMember(@RequestBody Member member) {
        return memberService.getMember(member);
    }

    @RequestMapping("/updateMember")
    public Result updateMember(@RequestBody Member member) {
        return memberService.updateMember(member);
    }

    @RequestMapping("/deleteMember")
    public Result deleteMember(@RequestBody Member member) {
        return memberService.deleteMember(member);
    }

    @RequestMapping("/listMember")
    public Result listMember(@RequestBody Member member) {
        return memberService.listMember(member);
    }
}